<include file="Public:header" />
<!-- MAIN CONTENT start -->
<literal>
    <style>
        .table th, .table td {
            text-align: center;
            /*height:38px;*/
        }
    </style>
    <script>
        function CurrentTime(){
            var myDate = new Date();
            var y = myDate.getFullYear();
            var m = myDate.getMonth();
            var d = myDate.getDate();
            var h = myDate.getHours();
            var i = myDate.getMinutes();
            var s = myDate.getSeconds();
            var current = y+"-"+m+"-"+d+" "+(h>=10? h:"0"+h)+":"+(i>10?i:"0"+i)+":"+(s>10? s:"0"+s)+" ";
            $("span[node-type='currentTime']").text(current);
            setTimeout('CurrentTime()',1000);
        }
        $(document).ready(function(){
            CurrentTime();
        })
    </script>
</literal>
<div class="span12">
    <div class="well blank-slate">
        <h3>
            Contest{$contest_info.contest_id}--{$contest_info.title}
        </h3>
        <p >
            Start Time: {$contest_info.start_time|date='Y-m-d H:i:s',###}&nbsp;&nbsp;End Time: {$contest_info.end_time|date='Y-m-d H:i:s',###}
        </p>
        <p>
            Current Time:<span node-type="currentTime" id="nowdate"></span>&nbsp;&nbsp;Status:
            <if condition="$v.end_time lt $now ">
                Ended
                <elseif condition="$v.start_time gt $now"/>
                Start
                <else/>
                Running
            </if>
            <if condition="$contest_info.private eq 0">
                <span class="label label-success">Public</span>
                <else/>
                <span class="label label-warning">Private</span>

            </if>
        </p>
    </div>
    <div class="well blank-slate">
        <h4>Problem List</h4>
        <!--<form class="form-search marg_bot">-->
            <!--<span >关键字查询</span>-->
            <!--<input type="text" name="keywords" value="{$keywords}" placeholder="输入关键字"/>-->
            <!--<button type="submit" class="btn">查找</button>-->
        <!--</form>-->
        <table class="table table-striped table-bordered table-hover">
            <thead>
                <tr>
                    <th>题目编号</th>
                    <th>标题</th>
                    <th>来源</th>
                    <th>正确</th>
                    <th>提交</th>
                </tr>
            </thead>
            <tbody>
            <foreach name="list" key="k" item="v">
                <tr>
                    <td>
                        {$v.problem_id}
                    </td>
                    <td>
                        <a href="{:U('Problem/viewProblem',array('id'=>$v['problem_id']))}">{$v.title}</a>
                    </td>
                    <td >
                        {$v.source}
                    </td><td >
                    {$v.solved}
                </td><td >
                    {$v.submit}
                </td>
                </tr>
            </foreach>
            <tr>
                <td colspan="6" align="center"> {$page}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<!-- MAIN CONTENT end-->
<include file="Public:footer" />